USE [master]
GO
/****** Object:  Database [EasyERP]    Script Date: 2024/5/29 13:17:40 ******/
CREATE DATABASE [EasyERP]
 CONTAINMENT = NONE
 ON  PRIMARY 
( NAME = N'EasyERP', FILENAME = N'D:\SqlDB\EasyERP.mdf' , SIZE = 8192KB , MAXSIZE = UNLIMITED, FILEGROWTH = 65536KB )
 LOG ON 
( NAME = N'EasyERP_log', FILENAME = N'D:\SqlDB\EasyERP_log.ldf' , SIZE = 8192KB , MAXSIZE = 2048GB , FILEGROWTH = 65536KB )
 WITH CATALOG_COLLATION = DATABASE_DEFAULT, LEDGER = OFF
GO
ALTER DATABASE [EasyERP] SET COMPATIBILITY_LEVEL = 120
GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [EasyERP].[dbo].[sp_fulltext_database] @action = 'enable'
end
GO
ALTER DATABASE [EasyERP] SET ANSI_NULL_DEFAULT OFF 
GO
ALTER DATABASE [EasyERP] SET ANSI_NULLS OFF 
GO
ALTER DATABASE [EasyERP] SET ANSI_PADDING OFF 
GO
ALTER DATABASE [EasyERP] SET ANSI_WARNINGS OFF 
GO
ALTER DATABASE [EasyERP] SET ARITHABORT OFF 
GO
ALTER DATABASE [EasyERP] SET AUTO_CLOSE OFF 
GO
ALTER DATABASE [EasyERP] SET AUTO_SHRINK OFF 
GO
ALTER DATABASE [EasyERP] SET AUTO_UPDATE_STATISTICS ON 
GO
ALTER DATABASE [EasyERP] SET CURSOR_CLOSE_ON_COMMIT OFF 
GO
ALTER DATABASE [EasyERP] SET CURSOR_DEFAULT  GLOBAL 
GO
ALTER DATABASE [EasyERP] SET CONCAT_NULL_YIELDS_NULL OFF 
GO
ALTER DATABASE [EasyERP] SET NUMERIC_ROUNDABORT OFF 
GO
ALTER DATABASE [EasyERP] SET QUOTED_IDENTIFIER OFF 
GO
ALTER DATABASE [EasyERP] SET RECURSIVE_TRIGGERS OFF 
GO
ALTER DATABASE [EasyERP] SET  DISABLE_BROKER 
GO
ALTER DATABASE [EasyERP] SET AUTO_UPDATE_STATISTICS_ASYNC OFF 
GO
ALTER DATABASE [EasyERP] SET DATE_CORRELATION_OPTIMIZATION OFF 
GO
ALTER DATABASE [EasyERP] SET TRUSTWORTHY OFF 
GO
ALTER DATABASE [EasyERP] SET ALLOW_SNAPSHOT_ISOLATION OFF 
GO
ALTER DATABASE [EasyERP] SET PARAMETERIZATION SIMPLE 
GO
ALTER DATABASE [EasyERP] SET READ_COMMITTED_SNAPSHOT OFF 
GO
ALTER DATABASE [EasyERP] SET HONOR_BROKER_PRIORITY OFF 
GO
ALTER DATABASE [EasyERP] SET RECOVERY FULL 
GO
ALTER DATABASE [EasyERP] SET  MULTI_USER 
GO
ALTER DATABASE [EasyERP] SET PAGE_VERIFY CHECKSUM  
GO
ALTER DATABASE [EasyERP] SET DB_CHAINING OFF 
GO
ALTER DATABASE [EasyERP] SET FILESTREAM( NON_TRANSACTED_ACCESS = OFF ) 
GO
ALTER DATABASE [EasyERP] SET TARGET_RECOVERY_TIME = 60 SECONDS 
GO
ALTER DATABASE [EasyERP] SET DELAYED_DURABILITY = DISABLED 
GO
ALTER DATABASE [EasyERP] SET ACCELERATED_DATABASE_RECOVERY = OFF  
GO
EXEC sys.sp_db_vardecimal_storage_format N'EasyERP', N'ON'
GO
ALTER DATABASE [EasyERP] SET QUERY_STORE = ON
GO
ALTER DATABASE [EasyERP] SET QUERY_STORE (OPERATION_MODE = READ_WRITE, CLEANUP_POLICY = (STALE_QUERY_THRESHOLD_DAYS = 30), DATA_FLUSH_INTERVAL_SECONDS = 900, INTERVAL_LENGTH_MINUTES = 60, MAX_STORAGE_SIZE_MB = 1000, QUERY_CAPTURE_MODE = AUTO, SIZE_BASED_CLEANUP_MODE = AUTO, MAX_PLANS_PER_QUERY = 200, WAIT_STATS_CAPTURE_MODE = ON)
GO
USE [EasyERP]
GO
/****** Object:  UserDefinedFunction [dbo].[Get_Message]    Script Date: 2024/5/29 13:17:40 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date, ,>
-- Description:	<异常信息管理，1开头的是SQL中的异常,2开头的是窗体中非空的异常>
-- =============================================
CREATE FUNCTION [dbo].[Get_Message]
(
    @msg_cd NVARCHAR(10)
)
RETURNS NVARCHAR(500)
AS
BEGIN
    DECLARE @msg_text NVARCHAR(500);

    SELECT @msg_text = 
		CASE
			WHEN @msg_cd = N'1001' THEN N'系统里已经存在相同的数据，请确认。'
			WHEN @msg_cd = N'1002' THEN N'系统无法找到要删除的数据，请确认。'
			WHEN @msg_cd = N'1003' THEN N'系统无法找到要修改的数据，请确认。'
			WHEN @msg_cd = N'1004' THEN N'系统没有找到任何数据，请确认查询条件是否正确。'
			WHEN @msg_cd = N'1005' THEN	N'保存完成，系统已重新查询数据。'
			WHEN @msg_cd = N'1006' THEN	N'该主代码中有对应的子代码信息，若要删除，请先删除对应的子代码信息。'
			WHEN @msg_cd = N'1007' THEN	N'该商品信息已经产生采购订单,请先删除关联采购订单中的商品。'
			WHEN @msg_cd = N'1008' THEN	N'该商品信息已经产生销售订单,请先删除关联销售订单中的商品。'
			WHEN @msg_cd = N'1009' THEN	N'该商品信息已经登记商品单价,请先删除相关商品单价中的商品。'
			WHEN @msg_cd = N'1010' THEN	N'该往来信息已经产生采购订单,请先删除关联采购订单。'
			WHEN @msg_cd = N'1011' THEN	N'该往来信息已经产生销售订单,请先删除关联销售订单。'
			WHEN @msg_cd = N'1012' THEN	N'该往来信息已经产生商品单价,请先删除关联商品单价。'

			WHEN @msg_cd = N'2001' THEN	N'主代码编号不能为空，请确认。'
			WHEN @msg_cd = N'2002' THEN	N'主代码名称不能为空，请确认。'

			WHEN @msg_cd = N'2003' THEN	N'红色文本框为必填项，不能为空，请确认。'
			WHEN @msg_cd = N'2004' THEN	N'子代码编号不能为空，请确认。'
			WHEN @msg_cd = N'2005' THEN	N'子代码名称不能为空，请确认。'

			WHEN @msg_cd = N'2006' THEN	N'采购方和销售方必须选择一个，或者两个都选,请确认。'
			WHEN @msg_cd = N'2007' THEN	N'输入的数据类型不正确，请确认输入的是数值类型！'

			WHEN @msg_cd = N'2008' THEN	N'税率编号不能为空，请确认。'
			WHEN @msg_cd = N'2009' THEN	N'税率名称不能为空，请确认。'
			WHEN @msg_cd = N'2010' THEN	N'税率比例不能为空，请确认。'

			WHEN @msg_cd = N'2011' THEN	N'人员编号不能为空，请确认。'
			WHEN @msg_cd = N'2012' THEN	N'人员名称不能为空，请确认。'
			WHEN @msg_cd = N'2013' THEN	N'电话号码不能为空，请确认。'
			WHEN @msg_cd = N'2014' THEN	N'所属部门不能为空，请确认。'

			WHEN @msg_cd = N'2015' THEN	N'商品编号不能为空，请确认。'
			WHEN @msg_cd = N'2016' THEN	N'商品名称不能为空，请确认。'
			WHEN @msg_cd = N'2017' THEN	N'商品单价不能为空，请确认。'
			WHEN @msg_cd = N'2018' THEN	N'商品单位不能为空，请确认。'
			WHEN @msg_cd = N'2019' THEN	N'商品分类不能为空，请确认。'

			WHEN @msg_cd = N'2020' THEN	N'往来信息编号不能为空，请确认。'



			WHEN @msg_cd = N'2100' THEN	N'当前有尚未保存的数据，继续请按 YES/是，否则请按 NO/否。'
			WHEN @msg_cd = N'2101' THEN	N'您确认要删除数据吗？确认请按 YES/是，否则请按 NO/否。'

        ELSE NULL END;

    RETURN @msg_text;

END;
GO
/****** Object:  UserDefinedFunction [dbo].[Get_Minor_nm]    Script Date: 2024/5/29 13:17:40 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date, ,>
-- Description:	<查询子代码名称>
-- =============================================
CREATE FUNCTION [dbo].[Get_Minor_nm]
(
	@major_cd NVARCHAR(6),
	@minor_cd NVARCHAR(6)
)
RETURNS NVARCHAR(50)
AS
BEGIN

	DECLARE @minor_nm NVARCHAR(50);
	SELECT @minor_nm = minor_nm FROM dbo.b_minor WHERE major_cd = @major_cd AND minor_cd = @minor_cd;
	
	IF @minor_nm = '' OR @minor_nm IS NULL
		SET @minor_nm = @minor_cd;

	RETURN @minor_nm;
END
GO
/****** Object:  Table [dbo].[b_item]    Script Date: 2024/5/29 13:17:40 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[b_item](
	[item_cd] [nvarchar](10) NOT NULL,
	[item_nm] [nvarchar](50) NOT NULL,
	[item_spec] [nvarchar](100) NULL,
	[item_price] [numeric](18, 4) NOT NULL,
	[item_unit] [nvarchar](4) NOT NULL,
	[item_group] [nvarchar](4) NOT NULL,
	[sl_cd] [nvarchar](4) NULL,
	[remark] [nvarchar](200) NULL,
	[ins_user] [nvarchar](6) NOT NULL,
	[ins_date] [datetime] NOT NULL,
	[up_user] [nvarchar](6) NOT NULL,
	[up_date] [datetime] NOT NULL,
 CONSTRAINT [PK_b_item] PRIMARY KEY CLUSTERED 
(
	[item_cd] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[b_item_price]    Script Date: 2024/5/29 13:17:40 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[b_item_price](
	[bp_cd] [nvarchar](10) NOT NULL,
	[item_cd] [nvarchar](10) NOT NULL,
	[item_price] [numeric](18, 4) NOT NULL,
	[remark] [nvarchar](200) NULL,
	[ins_user] [nvarchar](6) NOT NULL,
	[ins_date] [datetime] NOT NULL,
	[up_user] [nvarchar](6) NOT NULL,
	[up_date] [datetime] NOT NULL,
 CONSTRAINT [PK_b_item_pirce] PRIMARY KEY CLUSTERED 
(
	[bp_cd] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[b_major]    Script Date: 2024/5/29 13:17:40 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[b_major](
	[major_cd] [nvarchar](6) NOT NULL,
	[major_nm] [nvarchar](50) NOT NULL,
	[remark] [nvarchar](100) NULL,
	[ins_user] [nvarchar](6) NOT NULL,
	[ins_date] [datetime] NOT NULL,
	[up_user] [nvarchar](6) NOT NULL,
	[up_date] [datetime] NOT NULL,
 CONSTRAINT [PK_b_major] PRIMARY KEY CLUSTERED 
(
	[major_cd] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[b_minor]    Script Date: 2024/5/29 13:17:40 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[b_minor](
	[major_cd] [nvarchar](50) NOT NULL,
	[minor_cd] [nvarchar](50) NOT NULL,
	[minor_nm] [nvarchar](50) NOT NULL,
	[remark] [nvarchar](100) NULL,
	[ins_user] [nvarchar](6) NOT NULL,
	[ins_date] [datetime] NOT NULL,
	[up_user] [nvarchar](6) NOT NULL,
	[up_date] [datetime] NOT NULL,
 CONSTRAINT [PK_b_minor] PRIMARY KEY CLUSTERED 
(
	[major_cd] ASC,
	[minor_cd] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[b_partner]    Script Date: 2024/5/29 13:17:40 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[b_partner](
	[bp_cd] [nvarchar](20) NOT NULL,
	[bp_full_nm] [nvarchar](100) NOT NULL,
	[bp_nm] [nvarchar](50) NOT NULL,
	[bp_addr] [nvarchar](200) NOT NULL,
	[bp_reper] [nvarchar](20) NOT NULL,
	[bp_tel] [nvarchar](20) NOT NULL,
	[bp_email] [nvarchar](30) NULL,
	[bp_tax] [nvarchar](30) NULL,
	[so_flag] [nvarchar](2) NOT NULL,
	[po_flag] [nvarchar](2) NOT NULL,
	[bank_cd] [nvarchar](10) NOT NULL,
	[bank_acct_no] [nvarchar](30) NOT NULL,
	[pay_type] [nvarchar](4) NOT NULL,
	[remark] [nvarchar](200) NULL,
	[ins_user] [nvarchar](6) NOT NULL,
	[ins_date] [datetime] NOT NULL,
	[up_user] [nvarchar](6) NOT NULL,
	[up_date] [datetime] NOT NULL,
 CONSTRAINT [PK_b_partner] PRIMARY KEY CLUSTERED 
(
	[bp_cd] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[b_tax]    Script Date: 2024/5/29 13:17:40 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[b_tax](
	[tax_cd] [nvarchar](10) NOT NULL,
	[tax_nm] [nvarchar](30) NOT NULL,
	[tax_rate] [numeric](18, 4) NOT NULL,
	[remark] [nvarchar](200) NULL,
	[ins_user] [nvarchar](6) NOT NULL,
	[ins_date] [datetime] NOT NULL,
	[up_user] [nvarchar](6) NOT NULL,
	[up_date] [datetime] NOT NULL,
 CONSTRAINT [PK_b_tax] PRIMARY KEY CLUSTERED 
(
	[tax_cd] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[b_user]    Script Date: 2024/5/29 13:17:40 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[b_user](
	[user_cd] [nvarchar](6) NOT NULL,
	[user_nm] [nvarchar](20) NOT NULL,
	[tel_no] [nvarchar](20) NOT NULL,
	[dept_nm] [nvarchar](30) NOT NULL,
	[remark] [nvarchar](200) NULL,
	[ins_user] [nvarchar](6) NOT NULL,
	[ins_date] [datetime] NOT NULL,
	[up_user] [nvarchar](6) NOT NULL,
	[up_date] [datetime] NOT NULL,
 CONSTRAINT [PK_b_user] PRIMARY KEY CLUSTERED 
(
	[user_cd] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[sys_user]    Script Date: 2024/5/29 13:17:40 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[sys_user](
	[user_id] [nvarchar](6) NOT NULL,
	[user_pwd] [nvarchar](100) NOT NULL,
	[lasr_enter_date] [datetime] NOT NULL,
	[user_cd] [nvarchar](6) NOT NULL,
	[remark] [nvarchar](200) NULL,
	[ins_user] [nvarchar](6) NOT NULL,
	[ins_date] [datetime] NOT NULL,
	[up_user] [nvarchar](6) NOT NULL,
	[up_date] [datetime] NOT NULL,
 CONSTRAINT [PK_sys_user] PRIMARY KEY CLUSTERED 
(
	[user_id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC [EasyERP].sys.sp_addextendedproperty @name=N'MS_Description', @value=N'简单进销存数据库' 
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'商品编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_item', @level2type=N'COLUMN',@level2name=N'item_cd'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'商品名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_item', @level2type=N'COLUMN',@level2name=N'item_nm'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'商品规格' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_item', @level2type=N'COLUMN',@level2name=N'item_spec'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'商品单价' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_item', @level2type=N'COLUMN',@level2name=N'item_price'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'商品单位' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_item', @level2type=N'COLUMN',@level2name=N'item_unit'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'商品分类' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_item', @level2type=N'COLUMN',@level2name=N'item_group'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'默认仓库' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_item', @level2type=N'COLUMN',@level2name=N'sl_cd'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'插入人员编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_item', @level2type=N'COLUMN',@level2name=N'ins_user'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'插入时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_item', @level2type=N'COLUMN',@level2name=N'ins_date'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改人员编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_item', @level2type=N'COLUMN',@level2name=N'up_user'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_item', @level2type=N'COLUMN',@level2name=N'up_date'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'商品信息表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_item'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'单位编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_item_price', @level2type=N'COLUMN',@level2name=N'bp_cd'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'商品编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_item_price', @level2type=N'COLUMN',@level2name=N'item_cd'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'商品单价' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_item_price', @level2type=N'COLUMN',@level2name=N'item_price'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_item_price', @level2type=N'COLUMN',@level2name=N'remark'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'插入人员编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_item_price', @level2type=N'COLUMN',@level2name=N'ins_user'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'插入时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_item_price', @level2type=N'COLUMN',@level2name=N'ins_date'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改人员编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_item_price', @level2type=N'COLUMN',@level2name=N'up_user'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_item_price', @level2type=N'COLUMN',@level2name=N'up_date'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'商品往来单价信息表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_item_price'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'主代码编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_major', @level2type=N'COLUMN',@level2name=N'major_cd'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'主代码名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_major', @level2type=N'COLUMN',@level2name=N'major_nm'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_major', @level2type=N'COLUMN',@level2name=N'remark'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'插入人员编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_major', @level2type=N'COLUMN',@level2name=N'ins_user'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'插入时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_major', @level2type=N'COLUMN',@level2name=N'ins_date'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改人员编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_major', @level2type=N'COLUMN',@level2name=N'up_user'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_major', @level2type=N'COLUMN',@level2name=N'up_date'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'主代码表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_major'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'主代码编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_minor', @level2type=N'COLUMN',@level2name=N'major_cd'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'子代码编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_minor', @level2type=N'COLUMN',@level2name=N'minor_cd'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'子代码名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_minor', @level2type=N'COLUMN',@level2name=N'minor_nm'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_minor', @level2type=N'COLUMN',@level2name=N'remark'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'插入人员编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_minor', @level2type=N'COLUMN',@level2name=N'ins_user'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'插入时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_minor', @level2type=N'COLUMN',@level2name=N'ins_date'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改人员编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_minor', @level2type=N'COLUMN',@level2name=N'up_user'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_minor', @level2type=N'COLUMN',@level2name=N'up_date'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'子代码表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_minor'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'单位编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_partner', @level2type=N'COLUMN',@level2name=N'bp_cd'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'单位全称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_partner', @level2type=N'COLUMN',@level2name=N'bp_full_nm'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'单位简称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_partner', @level2type=N'COLUMN',@level2name=N'bp_nm'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'单位地址' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_partner', @level2type=N'COLUMN',@level2name=N'bp_addr'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'单位联系人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_partner', @level2type=N'COLUMN',@level2name=N'bp_reper'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'电话号码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_partner', @level2type=N'COLUMN',@level2name=N'bp_tel'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'电子邮箱' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_partner', @level2type=N'COLUMN',@level2name=N'bp_email'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'税号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_partner', @level2type=N'COLUMN',@level2name=N'bp_tax'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'单位分类（采购方）' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_partner', @level2type=N'COLUMN',@level2name=N'so_flag'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'单位分类（供应方）' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_partner', @level2type=N'COLUMN',@level2name=N'po_flag'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'银行编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_partner', @level2type=N'COLUMN',@level2name=N'bank_cd'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'银行账号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_partner', @level2type=N'COLUMN',@level2name=N'bank_acct_no'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'默认付款方式' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_partner', @level2type=N'COLUMN',@level2name=N'pay_type'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_partner', @level2type=N'COLUMN',@level2name=N'remark'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'插入人员编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_partner', @level2type=N'COLUMN',@level2name=N'ins_user'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'插入时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_partner', @level2type=N'COLUMN',@level2name=N'ins_date'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改人员编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_partner', @level2type=N'COLUMN',@level2name=N'up_user'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_partner', @level2type=N'COLUMN',@level2name=N'up_date'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'往来单位信息表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_partner'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'税率编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_tax', @level2type=N'COLUMN',@level2name=N'tax_cd'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'税率名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_tax', @level2type=N'COLUMN',@level2name=N'tax_nm'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'税率比例' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_tax', @level2type=N'COLUMN',@level2name=N'tax_rate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_tax', @level2type=N'COLUMN',@level2name=N'remark'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'插入人员编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_tax', @level2type=N'COLUMN',@level2name=N'ins_user'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'插入时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_tax', @level2type=N'COLUMN',@level2name=N'ins_date'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改人员编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_tax', @level2type=N'COLUMN',@level2name=N'up_user'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_tax', @level2type=N'COLUMN',@level2name=N'up_date'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'税率表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_tax'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'人员编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_user', @level2type=N'COLUMN',@level2name=N'user_cd'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'人员姓名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_user', @level2type=N'COLUMN',@level2name=N'user_nm'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'联系方式' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_user', @level2type=N'COLUMN',@level2name=N'tel_no'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'所在部门' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_user', @level2type=N'COLUMN',@level2name=N'dept_nm'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_user', @level2type=N'COLUMN',@level2name=N'remark'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'插入人员编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_user', @level2type=N'COLUMN',@level2name=N'ins_user'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'插入时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_user', @level2type=N'COLUMN',@level2name=N'ins_date'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改人员编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_user', @level2type=N'COLUMN',@level2name=N'up_user'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_user', @level2type=N'COLUMN',@level2name=N'up_date'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'人员信息表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'b_user'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'人员编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'sys_user', @level2type=N'COLUMN',@level2name=N'user_id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'登录密码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'sys_user', @level2type=N'COLUMN',@level2name=N'user_pwd'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'最后登录时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'sys_user', @level2type=N'COLUMN',@level2name=N'lasr_enter_date'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'关联人员编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'sys_user', @level2type=N'COLUMN',@level2name=N'user_cd'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'sys_user', @level2type=N'COLUMN',@level2name=N'remark'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'插入人员编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'sys_user', @level2type=N'COLUMN',@level2name=N'ins_user'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'插入时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'sys_user', @level2type=N'COLUMN',@level2name=N'ins_date'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改人员编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'sys_user', @level2type=N'COLUMN',@level2name=N'up_user'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'sys_user', @level2type=N'COLUMN',@level2name=N'up_date'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'系统用户表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'sys_user'
GO
USE [master]
GO
ALTER DATABASE [EasyERP] SET  READ_WRITE 
GO
